from django.shortcuts import render
from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
from rest_framework import permissions
from ..models.Servicio import Servicio


class ServicioSerializer(serializers.ModelSerializer):

    class Meta:
        model = Servicio
        #fields = ('nombre_residencia', 'num_habitacion', 'telefono','descripcion','direccion')


class ServicioViewSet(viewsets.ModelViewSet):  # API REST
    queryset = Servicio.objects.filter()
    serializer_class = ServicioSerializer
    # permission_classes = [permissions.IsAuthenticated]
